﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace KSASupport.BlobTracking
{

    /// <summary>
    /// Blobside stores which side of the unit the blob appears to originate from (calculated from hover data)
    /// </summary>
    public enum BlobSide { None,Left, Top, Right, Bottom }
    /// <summary>
    /// A blob structure used for the detection algorithn
    /// </summary>
    public class SimpleBlob
    {
        /// <summary>
        /// Unique id
        /// </summary>
        static public int CurrentID;
        /// <summary>
        /// Array of points contained in the blob
        /// </summary>
        public List<Point> points;
        /// <summary>
        /// Start point of a row as its detected
        /// </summary>
        public Point startPoint;
        /// <summary>
        /// Endpoint of consecutive points from the 'startpoint'
        /// </summary>
        public Point endPoint;

        public int Id;
        /// <summary>
        /// Side of the table the blob is originating from
        /// </summary>
        public BlobSide side;
        public Point edgePoint;
        public bool IsValid = true; // flag to track if we care about this blob anymore
        /// <summary>
        /// Instantiates a new instance of SimpleBlob
        /// </summary>
        public SimpleBlob()
        {
            SimpleBlob.CurrentID++;
            this.Id = CurrentID;
            points = new List<Point>();
            startPoint = new Point();
            endPoint = new Point();
            side = BlobSide.None;
            edgePoint = new Point();
        }

    }
}
